package com.gj.xxl.job.admin.core.route.strategy;

import com.gj.xxl.job.admin.core.route.RouteStrategy;

import java.util.List;
import java.util.Random;

/**
 * 随机策略
 */
public class RandomRouteStrategy implements RouteStrategy {

    private static Random random = new Random();

    @Override
    public String route(Integer jobId, List<String> addressList) {
        return addressList.get(random.nextInt(addressList.size()));
    }
}
